<?php

class Main extends CI_Controller
{
	public function index($year=null,$month=null)
	{
		$this->load->view('template/header');
		$data['calendar'] = $this->display($year, $month);
		
		$this->load->view('mymain',$data);
		$this->load->view('template/footer');
	}
	
	public function display($year = null, $month = null)
	{
		if(!$year)
		{
			$year = date('Y');
		}
		if(!$month)
		{
			$month = date('m');
		}

		$this->load->model("Mycal_model");
		
		return $this->Mycal_model->generate($year, $month);
	}
}